package com.fangrui.exception;

//Created by ✎﹏ℳ๓独赏☆独醉 on 2025/4/27 16:56

import com.fangrui.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**全局异常处理器
 * @return
 * @author ✎﹏ℳ๓独赏☆独醉
 * @created 2025/4/27 16:57
 **/
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result exception(Exception e) {
        e.printStackTrace();
        return Result.error(e.getMessage());
    }
}
